package com.zhiyizhen.callnumber.common;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.BuildConfig;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;

public class LogUtil {

    private LogUtil() {
    }

    public static void init() {
        PrettyFormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
                .tag("call")
                .showThreadInfo(false)
                .methodCount(1)
                .methodOffset(1)
                .build();

        Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy) {
            @Override public boolean isLoggable(int priority, String tag) {
                return true;
            }
        });
    }
    /**
     * Log a verbose message with optional format args.
     */
    public static void v(String message, Object... args) {
        Logger.v(message, args);
    }
    
    public static void w(String message, Object... args) {
        Logger.w(message, args);
    }

    /**
     * Log a debug message with optional format args.
     */
    public static void d(String message, Object... args) {
        Logger.d(message, args);
    }


    /**
     * Log a debug exception.
     */
    public static void d(Throwable t) {
        Logger.d(t);
    }

    /**
     * Log an info message with optional format args.
     */
    public static void i(String message, Object... args) {
        Logger.i(message, args);
    }

    /**
     * Log an error message with optional format args.
     */
    public static void e(String message, Object... args) {
        Logger.e(message, args);
    }

    /**
     * Log an error exception.
     */
    public static void e(Throwable t) {
        Logger.e(t, "");
    }


}
